package com.franklin.validation.demo;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.util.HashMap;
import java.util.Map;

/**
 * Description :
 * Create By: Franklin
 * Date : 2020/6/11 19:06
 */
@RestControllerAdvice
public class TestHandler {

    @ExceptionHandler(Exception.class)
    public Map test(Exception e){
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        stringStringHashMap.put("msg",e.getMessage());
        return stringStringHashMap;
    }
}
